#ifndef __LOG_H_
#define __LOG_H_

#define ORINT_LOG_FILE(logfd, name, CON, IS_ERROR,msg,mutex) \
    do { \
        pthread_mutex_lock(&mutex);\
        time_t now = time(NULL);\
        struct tm *tm_info = localtime(&now);\
        char time_buf[32];\
        char log_buf[1024];\
        strftime(time_buf, sizeof(time_buf), "%Y-%m-%d %H:%M:%S", tm_info);\
        snprintf(log_buf, sizeof(log_buf), "[%s]  %s:%d %s: %s\n", time_buf, name, CON, IS_ERROR, msg);\
        write(logfd, log_buf, strlen(log_buf));\
        pthread_mutex_unlock(&mutex);\
    } while (0)               


#endif